<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li :class="{completed:item.isDone}" v-for="item in showList" :key="item.id">
      <div class="view">
        <input v-model="item.isDone" class="toggle" type="checkbox" />
        <label>{{ item.name }}</label>
        <button class="destroy" @click="delId(item.id)"></button>
      </div>
    </li>
  </ul>
  
</template>

<script>
// 导出vuex数据
import {mapMutations,mapGetters} from 'vuex'
export default {
    name:'TodoMain',
    computed:{
        // ...mapState(['list'])
     ...mapGetters("todomodule",["showList"])
     },
    methods:{
        ...mapMutations("todomodule",["delId"]),
    }
}
</script>